import Vue from 'vue'
import VueRouter from 'vue-router'
import home from '../views/Home/home.vue'
import zsShopList from '../views/Food/zsShopList'
Vue.use(VueRouter)

const routes = [

  //默认进入首页
  {
    path:'/',
    redirect:'/home',   
  },
  //首页,默认是外卖栏
  { 
    path:'/home',
    name:'home',
    component:home,
  },
  //美食页
  {
    path:'/food',
    name:'food',
    component:()=>import ('../views/Food/food.vue'),
    meta:{
      footerflag:false    //是否需要底栏，如果需要可以不填，否则填false
    }
  },
  //商家详情页
  {
    path:'/shopDetial',
    name:'shopDetial',
    component:()=>import ('../views/ShopDetial/shopDetial.vue'),
  },
  //结算
  {
    path:'/checkOut',
    name:'checkOut',
    component:()=>import ('../views/CheckOut/checkOut.vue'),
    meta:{
      footerflag:false
    }
  },
   //商家列表页便于查看
   {
    path:'/zsShopList',
    name:'zsShopList',
    component:zsShopList,
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
